package com.hxx.controller;

import com.hxx.entity.TUser;
import com.hxx.server.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/userList")
    public String userList(Model model){
        List<TUser> users = userService.userList();
        model.addAttribute("users",users);
        return "userList";
    }
}
